public enum FileFormat {
    // 文档格式
    PDF("pdf", "application/pdf"),
    DOCX("docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"),
    DOC("doc", "application/msword"),
    XLSX("xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),
    XLS("xls", "application/vnd.ms-excel"),
    TXT("txt", "text/plain"),
    
    // 图片格式
    JPG("jpg", "image/jpeg"),
    JPEG("jpeg", "image/jpeg"),
    PNG("png", "image/png"),
    GIF("gif", "image/gif"),
    BMP("bmp", "image/bmp"),
    
    // 音频格式
    MP3("mp3", "audio/mpeg"),
    WAV("wav", "audio/wav"),
    AAC("aac", "audio/aac"),
    
    // 视频格式
    MP4("mp4", "video/mp4"),
    AVI("avi", "video/x-msvideo"),
    MKV("mkv", "video/x-matroska");
    
    private final String extension;
    private final String mimeType;
    
    FileFormat(String extension, String mimeType) {
        this.extension = extension;
        this.mimeType = mimeType;
    }
    
    public String getExtension() {
        return extension;
    }
    
    public String getMimeType() {
        return mimeType;
    }
    
    public static FileFormat fromExtension(String extension) {
        for (FileFormat format : values()) {
            if (format.extension.equalsIgnoreCase(extension)) {
                return format;
            }
        }
        throw new IllegalArgumentException("Unsupported file format: " + extension);
    }
} 